﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using FineAdmin.IService;
using FineAdmin.Model;
using FineAdmin.IRepository;
using FineAdmin.Common;

namespace FineAdmin.Service
{
    public class AdZoneService : BaseService<AdZoneModel>, IAdZoneService
    {
        public IAdZoneRepository AdZoneRepository { get; set; }
        public IEnumerable<AdZoneModel> GetAdZoneList()
        {
            return AdZoneRepository.GetAdZoneList();
        }


        public dynamic GetListByFilter(AdZoneModel filter, PageInfo pageInfo)
        {
            string _where = " where 1=1";
            if (filter.Name != null)
            {
                _where += string.Format(" and  Name like '%{0}%' ", filter.Name);
            }
            _where = CreateTimeWhereStr(filter.StartEndDate, _where);
            return GetListByFilter(filter, pageInfo, _where);
        }

    }

}